Note: This statement was previously named CheckpointOCR and is deprecated. Use OCRCheckpoint instead. See OCRCheckpoint.
Verifies graphical text in the screenshot captured for the action performed in the previous statement against an expect value using OCR comparison.
If the expected text value in the specified rectangle from the screenshot does not match the application during playback, the script fails or continues and displays a message in the Errors pane. For example, if the accuracy percentage is 84% and the accuracy calculated during playback is 80%, the checkpoint fails.
Syntax
OCRCheckpointPreviousStatement(Region, MinimumAccuracy, "ExpectedText", LeftEdgePixel, TopEdgePixel, RectangleWidth, RectangleHeight, FailureBehavior, "Warning")
Arguments
Argument | Description |
---|---|
Region | OCR region to check. OCRWindowRelative uses the pixel locations relative to the window that last had an action performed in it. OCRControlRelative uses the pixel locations relative to the control that last had an action performed on it. |
MinimumAccuracy | Minimum percentage of accuracy required to pass the checkpoint. |
ExpectedText | Text string to verify against the actual text. |
LeftEdgePixel | Integer pixel value of the left side of the rectangle that contains the text to verify. |
TopEdgePixel | Integer pixel value of the top side of the rectangle that contains the text to verify. |
RectangleWidth | Integer pixel value of the width of the rectangle that contains the text to verify. |
RectangleHeight | Integer pixel value of the height of the rectangle that contains the text to verify. |
FailureBehavior | Optional failure behavior. True stops the script if the checkpoint fails. False displays a warning and continues playback. If not specified, True is used. |
Warning | Optional message to display in the Errors pane and run report when checkpoints fail. |
Example
OCRCheckpointPreviousStatement(OCRControlRelative, 92, "PRODUCTS", 45, 163, 50, 50, True, "Products text is incorrect")